import * as tabBar from '@/utlis/tabbar.js'
export const isLogin = () =>{
	try {
		const value = uni.getStorageSync('user');
		console.log(value);
		if(!value){
			uni.navigateTo({url: '/pages/login/login' });
		}else{
			let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
			let curRoute = routes[routes.length - 1].route
			uni.switchTab({
				url:curRoute,
				fail() {
					uni.navigateTo({
						url:curRoute
					})
				}
			})
		}
	} catch (e) {
		// error
		uni.navigateTo({
			url:"/pages/login/login"
		})
	}
}